import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '@/views/login'
import mainPage from '@/views/mainPage'
import homePage from '@/views/homepage'

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/helloWorld',
      name: 'HelloWorld',
      component: HelloWorld
    }, {
      path: '/',
      name: 'Login',
      component: Login
    }, {
      path: '/mainPage',
      name: 'mainPage',
      meta: {
        requireAuth: true // 配置此条，进入页面前判断是否需要登陆
      },
      component: mainPage
    }, {
      path: '/homePage',
      name: 'homePage',
      meta: {
        requireAuth: true // 配置此条，进入页面前判断是否需要登陆
      },
      component: homePage
    }
  ],
  mode: "history"
})
